import { useEffect, useState } from "react"

export function useFirstLoading(minTime = 1500) {
  const [firstLoading, setFirstLoading] = useState(true)

  useEffect(() => {
    const timer = setTimeout(() => setFirstLoading(false), minTime)
    return () => clearTimeout(timer)
  }, [minTime])

  return { firstLoading, setFirstLoading }
}
